/*
 SplatterViewController.h
 
 The main view controller which sets up and handles a majority of the user interface.
 
 Created by David Kikuta.
 */

#import <UIKit/UIKit.h>
#import "InformationViewController.h"
#import "LoadingViewController.h"
#import "ColorChooser.h"
#import "ConfirmationViewController.h"

@interface SplatterViewController : UIViewController <LoadingViewControllerDelegate,
													  UIImagePickerControllerDelegate,
													  UIPopoverControllerDelegate,
													  ConfirmationViewControllerDelegate>
{
	float red;
	float green;
	float blue;
	float brushWidth;
	IBOutlet UITextField * currentColor;
	IBOutlet UIView * colorView;
	IBOutlet UIView * toolView;
	IBOutlet UISlider * redSlider;
	IBOutlet UISlider * greenSlider;
	IBOutlet UISlider * blueSlider;	
	IBOutlet UIButton * showTools;
	IBOutlet UIButton * hideTools;
	IBOutlet UIButton * showColors;
	IBOutlet UIButton * hideColors;
	IBOutlet UIBarButtonItem * openNavButton;
	IBOutlet UISegmentedControl * premadeColors;
	IBOutlet UIImageView * canvasView;
	IBOutlet UIImageView * currentColorView;
	IBOutlet UISlider * widthSlider;
	BOOL mouseSwiped;	
	BOOL localTouch;
	BOOL remoteTouch;
	UITapGestureRecognizer * tap;
    CGPoint lastPoint;
	UIImageView *drawImage;
	NSMutableArray * capturedImages;
	UIPopoverController * openWindow;
	UIPopoverController * infoWindow;
	UIPopoverController * confirmWindow;
	InformationViewController * p;
	LoadingViewController * loadingViewController;
	ColorChooser * chooser;
	ConfirmationViewController * confirmationViewController;
}

@property (nonatomic, retain) IBOutlet UIImageView * canvasView;
@property (nonatomic, retain) LoadingViewController * loadingViewController;
@property (nonatomic, retain) ConfirmationViewController * confirmationViewController;
@property (nonatomic, retain) NSMutableArray * capturedImages;

- (IBAction)toolButtonPressed:(UIButton *)sender;
- (IBAction)colorButtonPressed:(UIButton *)sender;
- (IBAction)redValueChanged:(UISlider *)sender;
- (IBAction)greenValueChanged:(UISlider *)sender;
- (IBAction)blueValueChanged:(UISlider *)sender;
- (IBAction)widthSliderChanged: (UISlider *)sender;
- (IBAction)newButtonPressed:(UIBarButtonItem *)sender;
- (IBAction)saveButtonPressed:(UIBarButtonItem *)sender;
- (IBAction)showInformationWindow:(UIBarButtonItem *)sender;
- (IBAction)connectButtonPressed:(UIBarButtonItem *)sender;
- (IBAction)premadeColorSelected:(UISegmentedControl *)sender;
- (IBAction)photoLibraryAction:(id)sender;
- (void)updateColorUI;
- (void)drawDot:(float)width withPreviousPoint:(CGPoint)previousPoint withCurrentPoint:(CGPoint)currentPoint redVal:(float)redValue greenVal:(float)greenValue blueVal:(float)blueValue;

@end

